cmake_minimum_required(VERSION 3.0)
project(mylog)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

file(GLOB SRC ${CMAKE_CURRENT_LIST_DIR}/src/*.cpp)
set(${PROJECT_NAME}_INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/include)

add_library(${PROJECT_NAME} STATIC ${SRC})

target_include_directories(${PROJECT_NAME} PUBLIC ${${PROJECT_NAME}_INCLUDE_DIR})
#target_link_libraries(${PROJNAME} )

if(WITH_TESTS)
    file(GLOB TEST_SRC ${CMAKE_CURRENT_LIST_DIR}/tests/*.cpp)

    add_executable(${PROJECT_NAME}_test ${TEST_SRC})

    target_include_directories(${PROJECT_NAME}_test PUBLIC ${${PROJECT_NAME}_INCLUDE_DIR})
    target_link_libraries(${PROJECT_NAME}_test ${PROJECT_NAME})
endif(WITH_TESTS)
